<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>down</h1>
<button id="exbtn">点击导出</button>
</body>
<script src="{{ asset('assets/js/jquery.js') }}"></script>
<script type="text/javascript">
    $('#exbtn').click(function(){
        var _dt = new Date();
        var yea = (_dt.getFullYear()).toString();
        var mon = _dt.getMonth()+1;
        if( mon<10 )
        {
            mon = ('0' + mon ).toString();
        }else{
            mon = mon.toString();
        }
        var _filename = yea + mon + '_' + _dt.valueOf();
//        var _filename = '201703_1489327031825';

//        console.log( $path );
        $.ajax({
            url: "{{ route('genoutputexcel') }}",
            type: 'get',
            dataType:'json',
            data:{ filename: _filename },
            success:function(data){
                window.location.href = "{{ route('downexcel') }}" + '/' + _filename ;
                console.log(data);
            }
        });
    });

    function getMax()
    {

    }

</script>
</html>